package com.project.core.interceptor;

import com.project.core.constant.ScoreConstant;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author mengxj
 */
@Component
public class AttachInterceptor implements HandlerInterceptor {

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        request.setAttribute(ScoreConstant.HANDLE_RESPONSE_KEY, ScoreConstant.HANDLE_RESPONSE_VALUE);
        return true;
    }
}
